package com.starblink.basic.style.view.viewpager

import android.content.Context
import android.util.AttributeSet
import android.view.MotionEvent
import androidx.viewpager.widget.ViewPager

/**
 *  Create by yuanl at 2023/5/18
 **/
class NoSwipeViewPager @JvmOverloads constructor(
    context: Context,
    attrs: AttributeSet? = null,
) : ViewPager(context, attrs) {

    var slidable: Boolean = true

    override fun onTouchEvent(ev: MotionEvent?): Boolean = slidable && super.onTouchEvent(ev)

    override fun onInterceptTouchEvent(ev: MotionEvent?): Boolean = slidable && super.onInterceptTouchEvent(ev)

}